// Device Creator
// (c) jimon game studio

#include "IDevice.h"

#include "CDevice_Win.h"
#include "CDevice_Linux.h"

namespace je
{
	namespace device
	{
		//! Create Enesea Device
		IDevice * JE_ENGINE_FUNCTION_CALL CreateDevice(DeviceType Type)
		{
			IDevice * Device = NULL;

			#if defined(JE_DEVICE_WIN) || defined(JE_DEVICE_LINUX)
			if(Type == DT_ANY_AVIABLE)
				Type = DT_SYSTEM;
			#endif

			switch(Type)
			{
			case DT_SYSTEM:
				{
					#ifdef JE_WIN
					JENEW(Device,CDevice_Win)
					#endif
					#ifdef JE_DEVICE_LINUX
					JENEW(Device,CDevice_Linux)
					#endif
					break;
				}
			default:
				break;
			}

			return Device;
		}
	}
}
